home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
0151.ZIP
/
TF.DOC
< prev
next >
Wrap
Text File
|
1985-10-28
|
8KB
|
196 lines
.he TF -- Text Formatter -- 15 Oct 85 Page #
.sh Fido Software 2269 Market St #118 San Francisco CA 94114
.pl 88
.. format 120f
TF is a text formatter that started out supporting some WordStar like dot commands, and ended up being extendedì
a bit. TF is most easy to use with Pmate and Index.
This is not an elaborate manual; it is mostly a place to write down the side effects and functions supportedì
until someone writes a real manual someday.
TF processes ASCII MSDOS text files. Dot commands are used to modify the way TF handles the text stream; linesì
beginning with a dot in the leftmost column are taken to be commands. Dot commands tend to make global changes, such asì
margins, headers, including other files, etc. These commands are listed later.
Control codes are used for other funtions, usually inline formatting and other controls, such as bold, underlineì
and other special features. Besides the usual CR, LF, FF and so on, otherwise undefined control codes can be used asì
macros; if properly defined, the control code itself is replaced with a string of characters. These strings can beì
defined with dot commands. Some are predefined to support an Okidata 192 printer, but these can be redefined at anyì
time.
.pa
Operation
TF processes a source file from disk and outputs to another file. The output filename by default is "PRN". Thisì
can be changed with a command line option.
TF is fairly quick in operation due to large buffers used for input and output.
TF inputfile/switches outfile/O /switches
Switches are:
/L Print line numbers
TF will number each line, from the first line of the file to the last.
/U No output graphics
TF will not do bold, underline nor double strike. For many printers this speeds up printing time greatly. Goodì
for making rough drafts.
/C 'C' source file
This causes TF to not generate a left margin, and to count wiggly brackets, comments and other C things, andì
puts one function on a page. If there are unbalanced parenthesis, brackets or comments, TF will tell you.
/T Top of page title
TF will print a header at the top of each page that lists the filename and time and date.
n/P Start at page n
TF will start printing at page number n. Please note that this is affected by any .pn commands in the file.
n/N Print only n pages
TF normally prints until the end of the fiel; this tells TF to print only n pages.
outfile/O Send output to outfile
Changes the output filename from PRN to whatever you specify.
.pa
Control Characters
TF does not output control codes found in the file. Instead, control codes are used to define "macros"; theì
contents of each macro defined is output instead of the control codes. The most common control codes are predefined asì
macros: CR returns CR, LF returns LF, etc. Others are preset to support Okidata 192 printer functtions.
Esentially, TF uses the control code as an index into a table; the contents of the table, if any, are output,ì
not the actual control code.
Please refer to the .def dot command for details on loading strings. Strings must be 8 characters or less.
The special WordStar like functions, ^B (bold), ^D (double strike) and ^S (underline) are handled specially. Ifì
there is a macro defined for these characters, then it is output; if not, then the backspace/print method is used. Toì
"undefine" a character, define it as zero.
The following are the predefined macros. They can be changed at any time.
^A ESC W 0 Okidata double wide off
^B ESC E Okidata emphasized
^C ESC F Okidata emphasized off
^E ESC I ^C Okidata CQ mode
^F ESC I ^A Okidata DP mode
^G ESC W 1 Okidata double wide on
^H ^H backspace
^I ^I tab
^J ^J linefeed
^L ^L formfeed
^M ^M carriage return
^N ESC % G Okidata italicized on
^O ESC % H Okidata italicized off
^S ESC - ^A Okidata underline on
^T ESC - ^@ Okidata underline off
^U DC2 Okidata 10CPI
^V ESC : Okidata 12CPI
^W DC4 Okidata 17.1CPI
Note that even CR, LF, etc are defined as macros.
.pa
Dot Commands
The dot commands all start if the leftmost column. There can be no space between the dot and the command name,ì
and unknown dot commands do not generate error messages.
Dot Command Summary
.pa Change page here
.he Top of page header
.sh Subheader.
.mt Margin at top
.mb Margin at bottom
.pl Page length
.lm Left margin
.pn Page number
.im Binary Image File
.def Control Character definition
.pa
.PA
Causes printing to start at the top of the next page. Unlike WordStar, the page number is not printed at theì
bottom of the page. Page numbers can only be printed in headers or subheaders at the top of the page. See .HE and .SH.
.HE <text>
.SH <text>
.HE (header) and .SH (subheader) operate in an identical manner. The header is printed at the very top of theì
page, and the subheader is printed on the next line.
The rest of the line following the .HE is used as a header at the top of each new page. If currently at the topì
of a page, the new header is used immediately, otherwise it wil not take effect until the next page change. Anyì
space character immediately following the .HE is skipped.
Every occurence of # is replaced with the current page number.
.MT <number>
.MB <number>
.MT is the number of lines from the top edge of the paper that text is printed, and defaults to 5. The headerì
and subheader are contained within the margin, i.e. text always starts at line 5 unless a .MT command changes it.
.MB is the margin at the bottom, and is basically the number of blank lines left before the bottom edge. A newì
page is started automatically if text would otherwise print in the margin area.
.PL <number>
This sets the number of lines per page, and defaults to 66, which is a normal 11 inch form.
.LM <number>
Set the left margin. The default here is eight columns, i.e. each line is indented 8 columns from the left handì
edge. Headers and subheaders are not affected.
The left margin can be set to any value from 0 to 60.
.PN <number>
Normally, page numbers start at 1 for the first page, and increments at every page change. .PN can be used toì
set the current page number, so that any .HE or .SH commands start at that number. This can be used to reserve pages forì
diagrams or photos.
.IN <filename>
Include the specified file as part of the text stream. The filename can be any legal DOS path. The contents ofì
the included file are treated as part of the priginal file. There can be only one level of include; included fies cannotì
include others.
.IM <filename>
Image file; this is a special file format for including graphic or other non-ASCII data.
The beginning of the file is assumed to contain a CR terminated line specifying the number of print lines theì
file is equivalent to. For example, if the file contains a graphic logo that consumes 6 lines when printed, the firstì
line should contain "6" followed by a CR. TF reads the first line to determine the effective length of the file, thenì
copies the rest of the file as-is to the output. The rest of the file can contain anything, including nulls and controlì
codes.
.DEF cc,n,n,n,n,n,n,n,n
Define the macros string for the specified control code. All control codes except ^B, ^D, ^S, ^K and ^P can beì
defined for output.
All numbers are in decimal. The first number following the .DEF statement is the code to be defined; 0 cannot beì
used. Up to 8 values can follow. Use 128 to insert a null.
Some are predefined; please refer to the control code section.